Aim: To build a 2D line, composed of a curve with flat sections to either side
In [41]:
import numpy as np
import matplotlib.pyplot as plt
In [42]:
Min_X = 0
Max_X = 8000
Amplitude = 800
Wavelength = 1600
SampleSpacing = 200
Range_X = Max_X - Min_X
NSamp = (Max_X - Min_X)/SampleSpacing
In [43]:
NSamp = (Max_X - Min_X)/SampleSpacing
In [44]:
# Fs = 8000
# f = 5
# sample = 16
# x = np.arange(sample)
# y = np.sin(2 * np.pi * f * x / Fs)
# plt.plot(x, y)
# plt.xlabel('voltage(V)')
# plt.ylabel('sample(n)')
# plt.show()
In [45]:
x = np.arange(Min_X, Max_X + SampleSpacing, SampleSpacing)
x
Out[45]:
In [46]:
y = Amplitude * np.cos(2. * np.pi) + 1
y
Out[46]:
In [47]:
np.arange(5)
Out[47]:
In [48]:
plt.plot(x, y)
plt.xlabel('voltage(V)')
plt.ylabel('sample(n)')
plt.show()
In [ ]: